<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
<jsp:useBean id="othhome_friend1" scope="session" class="software.Use_user"/>
<%@ page import="java.util.ArrayList" %>
<jsp:useBean id="othhome_friend2" scope="session" class="software.Fri_done"/>
 <jsp:useBean id="othhome_friend3" class="software.Paination" scope="session"/>
  <%@ page import="software.Paination" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>
    </title>
  </head>
  <body>
  
   <% 
   int IDseloth=0,IDoth=0;
    try{ 
     String IDseloth1=session.getAttribute("IDoth").toString();
      IDseloth=Integer.parseInt(IDseloth1);
     String IDoth1=session.getAttribute("IDoth").toString();
      IDoth=Integer.parseInt(IDoth1);   
     }catch(Exception e){
     e.printStackTrace();
     }
     int k=othhome_friend2.get_friend_sum(IDoth);%>
      <a href="othhome_main.jsp?IDseloth=<%=IDseloth%>&mk=1"">返回他的主页</a>
     <%
 	if(k==0){
    %>
   <p>目前没有好友！</p>
   <%
    }
    else
    {
 List<String> list1 = othhome_friend2.Fri_get_name(IDoth);
 othhome_friend3.initPageBean(list1);
 %>
  <form action="othhome_friend.jsp method="post" name="page" onsubmit="return checkPage(page)">
  <p>    
        共有<font color="red" size="1"><%=othhome_friend3.getTotalRows() %></font>个好友
        <br/>
       当前是第<font color="red" size="1"><%=othhome_friend3.getCurrentPage()+"/"+othhome_friend3.getTotalPages() %></font>页
       </p>
       <%if(othhome_friend3.isHasPreviousPage())
       out.print("<a href='othhome_friend2.jsp?requestPage=previousPage'>上一页</a>");%>
       <%if(othhome_friend3.isHasNextPage())
       out.print("<a href='othhome_friend2.jsp?requestPage=nextPage'>下一页</a>"); %>
       </form>
  	<%-- 分页显示--%>
     <table align="left" border="1" width="60" height="70">
     	<%
         List notes=othhome_friend3.getCurrentPageList();
           for(int m=0;m<notes.size();m++){   
           othhome_friend1.setUsername((String)notes.get(m));
    	  int Id3=othhome_friend1.getId(); 
           %>
          <tr bgcolor='#FFCC99' align="center">
          <td>
          <%=(String)notes.get(m)%>
     	 </td>
             </tr>
             <%
             }
             }
             %>
     </table>
  </body>
</html>